package com.kujie.im.config;

import com.easemob.im.ApiClient;
import com.easemob.im.api.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 环信API配置
 *
 * @author check
 * @date 2025-10-21
 */
@Configuration
public class HuanXinApiConfig {
    /**
     * 黑名单API实例
     *
     * @param apiClient ApiClient
     * @return BlockApi
     */
    @Bean
    public BlockApi blockApi(ApiClient apiClient) {
        return new BlockApi(apiClient);
    }

    /**
     * 文件API实例
     *
     * @param apiClient ApiClient
     * @return ChatFileApi
     */
    @Bean
    public ChatFileApi chatFileApi(ApiClient apiClient) {
        return new ChatFileApi(apiClient);
    }

    /**
     * 好友信息API实例
     *
     * @param apiClient ApiClient
     * @return ContactApi
     */
    @Bean
    public ContactApi contactApi(ApiClient apiClient) {
        return new ContactApi(apiClient);
    }

    /**
     * 群组API实例
     *
     * @param apiClient ApiClient
     * @return GroupApi
     */
    @Bean
    public GroupApi groupApi(ApiClient apiClient) {
        return new GroupApi(apiClient);
    }

    /**
     * 历史消息API实例
     *
     * @param apiClient ApiClient
     * @return HistoryMessageApi
     */
    @Bean
    public HistoryMessageApi historyMessageApi(ApiClient apiClient) {
        return new HistoryMessageApi(apiClient);
    }

    /**
     * 消息API实例
     *
     * @param apiClient ApiClient
     * @return MessageApi
     */
    @Bean
    public MessageApi messageApi(ApiClient apiClient) {
        return new MessageApi(apiClient);
    }

    /**
     * 群管理API实例
     *
     * @param apiClient ApiClient
     * @return MetadataApi
     */
    @Bean
    public MetadataApi metadataApi(ApiClient apiClient) {
        return new MetadataApi(apiClient);
    }

    /**
     * 群信息API实例
     *
     * @param apiClient ApiClient
     * @return PresenceApi
     */
    @Bean
    public PresenceApi presenceApi(ApiClient apiClient) {
        return new PresenceApi(apiClient);
    }

    /**
     * 推送API实例
     *
     * @param apiClient ApiClient
     * @return PushApi
     */
    @Bean
    public PushApi pushApi(ApiClient apiClient) {
        return new PushApi(apiClient);
    }

    /**
     * 表情回复API实例
     *
     * @param apiClient ApiClient
     * @return ReactionApi
     */
    @Bean
    public ReactionApi reactionApi(ApiClient apiClient) {
        return new ReactionApi(apiClient);
    }

    /**
     * 聊天室API实例
     *
     * @param apiClient ApiClient
     * @return RoomApi
     */
    @Bean
    public RoomApi roomApi(ApiClient apiClient) {
        return new RoomApi(apiClient);
    }

    /**
     * 子区API实例
     *
     * @param apiClient ApiClient
     * @return ThreadApi
     */
    @Bean
    public ThreadApi threadApi(ApiClient apiClient) {
        return new ThreadApi(apiClient);
    }

    /**
     * 令牌API实例
     *
     * @param apiClient ApiClient
     * @return TokenApi
     */
    @Bean
    public TokenApi tokenApi(ApiClient apiClient) {
        return new TokenApi(apiClient);
    }

    /**
     * 用户API实例
     *
     * @param apiClient ApiClient
     * @return UserApi
     */
    @Bean
    public UserApi userApi(ApiClient apiClient) {
        return new UserApi(apiClient);
    }
}
